//
//  ViewController.swift
//  枚举
//
//  Created by 崔博 on 2017/7/19.
//  Copyright © 2017年 崔博. All rights reserved.
//

import UIKit
enum Encoding {
    case ASCII
    case NEXTSTEP
    case JapaneseEUC
    case UTF8
}
enum Add<T,U> {
    case InLeft(T)
    case InRight(U)
}
struct Times<T,U> {
    let fst: T
    let snd: T
}
typealias One = ()
class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        let myEncoding = Encoding.ASCII + Encoding.UTF8
        
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }


}

extension Encoding {
    var nsStringEncoding: String.Encoding{
        
        switch self {
        case .ASCII: return String.Encoding.ascii
        case .JapaneseEUC: return String.Encoding.nextstep
        default: break
            
        }
    }
}
